﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<sp_GetPartnerResult>>" %>
<% 
        List<sp_GetPartnerResult> listGlobalSearch = (List<sp_GetPartnerResult>)ViewData.Model;
    if(listGlobalSearch.Count > 0)
    {%>
<ul style="list-style: none; width: 630px;">
    <% 
        foreach (sp_GetPartnerResult item in listGlobalSearch)
       {
           string alias = "/san-pham/" + item.Alias + ".html";%>
    <li style="width: 150px; float: left; padding-bottom: 10px;">
        <div class="prodformat_box">
            <div class="roundedcornr_top">
            </div>
            <div class="roundedcornr_content">
                <a href="<%=alias%>">
                    <img class="imag" src="<%=Constants.UPLOAD_VITUAL_IMAGE_PATH + item.Logo%>" width="132"
                        height="120" />
                </a>
                <div class="prodname_newrelease">
                <a href="<%=alias%>">
                    <strong>
                        <%= Html.Encode(item.PartnerName)%></strong></a></div>
                <br />
                <div class="pricebg_outabout">
                    <table class="prodprice_special">
                        <tbody>
                            <tr>
                                <td>
                                    <%=(!item.CurrentPrice.HasValue ? "Liên hệ" : String.Format("{0:0,0}", item.CurrentPrice))%>
                                    <% if (item.OldPrice.HasValue)
                                       { %>
                                    <div class="prodrrpprice">
                                        <%=String.Format("{0:0,0}", item.OldPrice.Value)%>
                                    </div>
                                    <%} %>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="roundedcornr_bottom">
                <div>
                </div>
            </div>
        </div>
    </li>
    <%} %>
</ul>
<div class="clr">
</div>
<div class="pagination">
    <%= Ajax.Pager(new AjaxOptions { UpdateTargetId = "globalSearch", OnBegin = "beginPaging", OnSuccess = "successPaging", OnFailure = "failurePaging" },
                                                                                     ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "Home", action = "GlobalSearch" })%>
</div>
<%}
    else
    { %>
    <div class="content_box">
        <div class="roundedcornr_top">
            <div>
            </div>
        </div>
        <div class="roundedcornr_content" style="padding: 5px;">
            <div class="validation">
                Không tìm thấy sản phẩm bạn cần
            </div>
            <br />
            <hr />
            <br />
            <div align="center">
                <p>
                </p>
            </div>
            <div class="clearfix">
            </div>
        </div>
        <div class="roundedcornr_bottom">
            <div>
            </div>
        </div>
    </div>
    <%} %>